home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Copyright © 1992-1993 Mark Pilgrim *
- * *
- * This file is provided as is, and may be freely distributed unaltered. This *
- * message must accompany any copy of this file. This file may be used or *
- * modified for use for a non-commercial product provided that appropriate *
- * credit is given to the author named above. *
- * Commercial use of this source code is prohibited. *
- ******************************************************************************/
-
- #include "msg misc.h"
- #include "msg timing.h"
-
- #define startgap 1
- #define gapratio 6
- #define zeropointH 15
- #define CorrectTime 3
-
- void CircleBulge(GrafPtr);
-
- /* This copies ovals that always run from the left of the screen to the right,
- but start really squashed and get geometrically taller. */
-
- void CircleBulge(GrafPtr sourceGrafPtr)
- {
- Rect theRect;
- Rect source;
- RgnHandle curregion;
- Point zeropoint;
- int cy=MAIN_WINDOW_HEIGHT/2;
- int gap=startgap;
-
- source.top=source.left=0;
- source.right=MAIN_WINDOW_WIDTH;
- source.bottom=MAIN_WINDOW_HEIGHT;
-
- theRect=source;
- theRect.top=cy-gap;
- theRect.bottom=cy+gap;
-
- curregion=NewRgn();
- zeropoint.v=0;
- zeropoint.h=zeropointH; /* when we copy zeropoint, it's time to stop */
- do
- {
- StartTiming();
-
- SetEmptyRgn(curregion);
- OpenRgn();
- FrameOval(&theRect); /* this makes the region for copying */
- CloseRgn(curregion);
-
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &source, &source, 0, curregion);
-
- theRect.top-=gap;
- theRect.bottom+=gap; /* make the oval taller */
- gap++;
- gap+=gap/gapratio; /* make the oval grow faster next time */
-
- TimeCorrection(CorrectTime);
- }
- while (!(PtInRgn(zeropoint, curregion))); /* quit when we hit zeropoint */
-
- CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
- &source, &source, 0, 0L); /* copy the whole screen to end it */
-
- DisposeRgn(curregion);
- }
-